<template>
  <a-config-provider :locale="zhCN">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import { domTitle, setDocumentTitle } from '@/utils/domUtil';
import { i18nRender } from '@/locales';
import { AppDeviceEnquire } from '@/utils/mixins';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
export default {
  data() {
    return { zhCN };
  },
  mixins: [AppDeviceEnquire],
  computed: {
    locale() {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta;
      title && setDocumentTitle(`${i18nRender(title)} - ${domTitle}`);
      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale;
    },
  },
};
</script>
<style lang="less">
#app {
  height: 100%;
}
@import '~ant-design-vue/es/style/themes/default.less';

html,
body,
#app,
#root {
  height: 100%;
}

.colorWeak {
  filter: invert(80%);
}

.ant-layout.layout-basic {
  height: 100vh;
  min-height: 100vh;
}

canvas {
  display: block;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul,
ol {
  list-style: none;
}

// 数据列表 样式
.table-alert {
  margin-bottom: 16px;
}
// 数据列表 操作
.table-operator {
  margin-bottom: 18px;

  button {
    margin-right: 8px;
  }
}
// 数据列表 搜索条件
.table-page-search-wrapper {
  .ant-form-inline {
    .ant-form-item {
      display: flex;
      margin-bottom: 24px;
      margin-right: 0;

      .ant-form-item-control-wrapper {
        flex: 1 1;
        display: inline-block;
        vertical-align: middle;
      }

      > .ant-form-item-label {
        line-height: 32px;
        padding-right: 8px;
        width: auto;
      }
      .ant-form-item-control {
        height: 32px;
        line-height: 32px;
      }
    }
  }

  .table-page-search-submitButtons {
    display: block;
    margin-bottom: 24px;
    white-space: nowrap;
  }
}

@keyframes loading-dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -40px;
  }
  to {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -120px;
  }
}
@keyframes loading-rotate {
  to {
    transform: rotate(1turn);
  }
}
@media (max-width: @screen-xs) {
  .ant-table {
    width: 100%;
    overflow-x: auto;
    &-thead > tr,
    &-tbody > tr {
      > th,
      > td {
        white-space: pre;
        > span {
          display: block;
        }
      }
    }
  }
}

// detail
.container {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  header {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    padding: 0 150px;
    box-sizing: border-box;
    .title {
      width: calc(100% - 64px);
      text-align: center;
      font-size: 26px;
      font-family: PingFangSC-Semibold;
      color: #000000;
      font-weight: 600;
    }
  }
  .content {
    width: 1150px;
    min-height: 300px;
    background: #fff;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;

    section {
      width: 100%;
      .list-item {
        width: 100%;
        height: 32px;
        background: #ecf5ff;
        border-left: 4px solid #53a7f0;
        line-height: 32px;
        padding-left: 20px;
        box-sizing: border-box;
        font-family: PingFangSC-Semibold;
        font-size: 17px;
        color: #000000;
        font-weight: 600;
        margin-top: 10px;
        &.red {
          border-color: #f49601;
        }
        &.grey {
          border-color: #13ca90;
        }
      }
      .row-item {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        padding: 0 10px;
        box-sizing: border-box;
        &.long {
          border-bottom: 1px solid #e8e8e8;
          .col-item {
            border: none !important;
          }
        }
      }
      .col-item {
        flex: 1 1 15%;
        line-height: 34px;
        border-bottom: 1px solid #e8e8e8;
        height: 34px;
        color: #666;
        font-weight: 400;
        font-size: 14px;
        font-family: PingFangSC-Regular;
        &.long {
          flex: 1 1 75%;
          line-height: 1.5;
          height: auto;
        }
      }
      .text-black {
        color: #000;
      }
    }
  }
}
</style>
